package model

import "gorm.io/gorm"

type Login struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(50)"`
}

type Users struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Tel      string `gorm:"type:varchar(30)"`
	Name     string `gorm:"type:varchar(30)"`
	Email    string `gorm:"type:varchar(30)"`
	Role     string `gorm:"type:varchar(30)"`
}

type UsersRole struct {
	gorm.Model
	Uid int `gorm:"type:int"`
	Rid int `gorm:"type:int"`
}

type Role struct {
	gorm.Model
	Uid      int    `gorm:"type:int"`
	Nid      int    `gorm:"type:int"`
	RoleName string `gorm:"type:varchar(30)"`
	Comment  string `gorm:"type:varchar(30)"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int"`
	Nid int `gorm:"type:int"`
}

type Node struct {
	gorm.Model
	NodeType string `gorm:"type:varchar(30)"`
	NodeName string `gorm:"type:varchar(30)"`
}

type Car struct {
	gorm.Model
	Name  string `gorm:"type:varchar(30)"`
	Types string `gorm:"type:varchar(30)"`
	Price string `gorm:"type:varchar(30)"`
	Num   string `gorm:"type:varchar(30)"`
	Time  string `gorm:"type:varchar(30)"`
}

type Order struct {
	gorm.Model
	Cid          int    `gorm:"type:int"`
	OrderId      int    `gorm:"type:int"`
	OrderTime    string `gorm:"type:varchar(30)"`
	OrderComment string `gorm:"type:varchar(30)"`
}

type CarOrder struct {
	OrderId      int
	OrderTime    string
	OrderComment string
	Name         string
	Types        string
	Price        string
	Num          string
	Time         string
}
